<template>
	<view>
		<view class="manage-bigbox">
			<view class="add-padding" v-for="(items,index) in sourceList" :key="index">
				<view class="manage-list flex">
					<view class="manage-list-title">{{items.name}}</view>
					<view class="flex">
						<view class="delect-btn"><img src="../../static/icon/icon_trash.png" alt="" class="img-sty"></view>
						<view class="change-btn"><img src="../../static/icon/icon_edit.png" alt="" class="img-sty"></view>
					</view>
				</view>
			</view>
			<view class="bottom-btn" @tap="handleClickAddSource">
				+简历来源
			</view>
		</view>
	</view>
</template>
<script>
	export default{
		data(){
			return{
				sourceList:[],
				limit: 10,
				page: 1,
			}
		},
		methods:{
			async reqResumeList(){
				// 取token
				try {
				    const value = uni.getStorageSync('login_key');
				    if (value) {
						this.token = value;
				    }
				} catch (e) {
				    // error
				}
				
				let url = this.ServicesApi.resumeChannelList;
				let data = {
				    limit: this.limit,
				    page: this.page,
				};
				let result = await this.Services.post(url, data);
				if (result.code == this.StatusCode.SUCCESS_CODE) {
				    this.sourceList = result.data.data;
				}
				
				// uni.request({
				//     url: this.ServicesApi.resumeChannelList, 
				// 	method:'POST',
				// 	header: {
						
				// 		"content-type":"application/x-www-form-urlencoded"
				// 	},
				//     data: {
				// 		token:this.token,
				//         page:1,
				// 		limit:10,
				//     },
				//     success: (res) => {
				//         // console.log(res.data.data.data);
				// 		if(res){
				// 			this.sourceList = res.data.data.data;
				// 		}
				//     }
				// });
			},
			handleClickAddSource(){
				uni.navigateTo({
					url: '/pages/talent_pool/add_resume_source'
				});
			}
		},
		mounted(){
			this.reqResumeList();
		}
	}
</script>
<style scoped lang="stylus">
	.manage-bigbox{
		margin-top:24upx;
		.add-padding{
			padding:0 40upx;
			background:#fff;
			.manage-list{
				height:108upx;
				align-items:center;
				justify-content:space-between;
				border-bottom:1px solid #DBDBDB;
				.manage-list-title{
					font-size:32upx;
					color:#333;
				}
				.delect-btn{
					margin-right:44upx;
				}
				.img-sty{
					height:38upx;
					width:38upx;
				}
			}
		}
		.bottom-btn{
			height:76upx;
			width:440upx;
			background:linear-gradient(270deg,rgba(0,106,231,1) 0%,rgba(66,157,255,1) 100%);
			line-height:76upx;
			text-align:center;
			color:#fff;
			font-size:32upx;
			margin:80upx auto;
		}
	}
</style>